package com.example.websocketdemo.websocketConfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

/**
 * TODO    该类的作用是配置服务端点，比如配置握手信息
 *
 * @ClassName MessageConfigurator
 * @Author xiaojiang
 * @Date 2021/9/29 下午 18:09
 */
public class MessageConfigurator extends ServerEndpointConfig.Configurator {

    private static Logger logger = LoggerFactory.getLogger(MessageConfigurator.class) ;

    @Override
    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
        logger.debug("握手请求头信息：" + request.getHeaders());
        logger.debug("握手响应头信息：" + response.getHeaders());
        super.modifyHandshake(sec, request, response);
    }


}
